package com.sf.hackathons.app.presenter.impl;


import com.sf.hackathons.app.bean.MailInfoCommitBean;
import com.sf.hackathons.app.helper.MailInfoCommitlHelper;
import com.sf.hackathons.app.presenter.constract.MailInfoConstract;
import com.sf.hackathons.lib.commui.base.BasePresenterImpl;
import com.sf.hackathons.lib.http.ICallBack;

/**
 * Created by guofanghua on 2017/9/20.
 */
public class MailInfoPresenter extends BasePresenterImpl<MailInfoConstract.View> implements MailInfoConstract.Presenter {


    @Override
    public void httpCommit(MailInfoCommitBean mMailInfoCommitBean) {
        getView().showProgress();
        MailInfoCommitlHelper mMainInfoCommitlHelper = new MailInfoCommitlHelper();
        mMainInfoCommitlHelper.mMailInfoCommitBean = mMailInfoCommitBean;
        mMainInfoCommitlHelper.setCallback(new ICallBack() {
            @Override
            public void onSuccess(int taskId, String result) {
                getView().dismissProgress();
                getView().commitSuccess();

            }

            @Override
            public void onFailed(int taskId, String errorCode, String msg) {
                getView().dismissProgress();
                getView().commitFail(errorCode, msg);
            }
        });
        mMainInfoCommitlHelper.sendHttpRequest();
    }
}